Skip to content

ReactiveOwningComponentBase class

Defined in

Namespace: ReactiveUI.Blazor Assembly: ReactiveUI.Blazor.dll Full name: ReactiveUI.Blazor.ReactiveOwningComponentBase<T> Modifiers: public

Summary

        A base component for handling property changes and updating the Blazor view appropriately.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1

Class hierarchy
classDiagram
class ReactiveOwningComponentBase~T~
class OwningComponentBase~T~
OwningComponentBase~T~ <|-- ReactiveOwningComponentBase~T~
class IViewFor~T~ {
    <>
}
IViewFor~T~ <|.. ReactiveOwningComponentBase~T~
class IViewFor {
    <>
}
IViewFor <|.. ReactiveOwningComponentBase~T~
class IActivatableView {
    <>
}
IActivatableView <|.. ReactiveOwningComponentBase~T~
class INotifyPropertyChanged {
    <>
}
INotifyPropertyChanged <|.. ReactiveOwningComponentBase~T~
class ICanActivate {
    <>
}
ICanActivate <|.. ReactiveOwningComponentBase~T~

Inherits from: OwningComponentBase

Implements: IViewFor, IViewFor, IActivatableView, INotifyPropertyChanged, ICanActivate

Remarks

This component triggers StateHasChanged when either the view model instance changes or the current view model raises PropertyChanged.

Trimming/AOT: this type avoids expression-tree-based ReactiveUI helpers (e.g. WhenAnyValue) and uses event-based observables instead.

This type derives from OwningComponentBase so the DI scope and owned service lifetime are managed by the base class.

Constructors

NameSummary
.ctor

Properties

NameSummary
ViewModelGets or sets the view model associated with this component.
ActivatedGets a observable which is triggered when the ViewModel is activated.
DeactivatedGets a observable which is triggered when the ViewModel is deactivated.

Methods

NameSummary
OnInitializedMethod invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.
OnAfterRenderMethod invoked after each time the component has rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any...
OnPropertyChangedInvokes the property changed event.
DisposeReleases the service scope used by the component.

Events

NameSummary
PropertyChanged
Inherited members